/*
 * boundary.h
 *
 *  Created on: 2012-12-5
 *      Author: shane
 */

#ifndef BOUNDARY_H_
#define BOUNDARY_H_
#include "../EME_exception.h"
namespace EME
{
class EME_boundary_logic_error: public EME_logic_error
{
public:
	inline explicit EME_boundary_logic_error(const std::string&s,
			unsigned int code) :
			EME_logic_error(s, code)
	{
	}
	;
};
class boundary
{
public:
	double pml_x;
	double pml_y;
	inline boundary() :
			pml_x(0.), pml_y(0.)
	{
	}
	;
	boundary(double pml_x_in, double pml_y_in) :
			pml_x(pml_x_in), pml_y(pml_y_in)
	{
	}
	;
	boundary(const boundary& b) :
			pml_x(b.pml_x), pml_y(b.pml_y)
	{
		if (pml_x < 0 || pml_y < 0)
			throw(EME_boundary_logic_error(
					"PML length cannot be set as negative number", 5001));
	}
	;
	inline bool if_pml()
	{
		return pml_x != 0 && pml_y != 0;
	}
	;
	inline bool if_pml_x()
	{
		return pml_x != 0;
	}
	;
	inline bool if_pml_y()
	{
		return pml_y != 0;
	}
	;
	~boundary()
	{
	}
	;
};

}

#endif /* BOUNDARY_H_ */
